/*
* INSANE - Interactive Structural Analysis Environment
*
* Copyright (C) 2003-2005
* Universidade Federal de Minas Gerais
* Escola de Engenharia
* Departamento de Engenharia de Estruturas
* 
* Author's email :    insane@dees.ufmg.br
* Author's website :  http://www.dees.ufmg.br/insane
* 
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
package br.ufmg.dees.insane.materialMedia.material;

import java.util.HashMap;

import br.ufmg.dees.insane.util.IMatrix;

/** A class representing Material's Polar Von Mises 
 * @author Jamile Fuina
 * @since 15/11/2005
 */
public class PolarVonMises extends VonMises {

	private static final long serialVersionUID = 1L;

	/** The keys for the Map. */
    /** Proportionality coefficient among strain and stress antisymmetric tensors.*/
	public final String ALPHA = "ALPHA";
	
	/** Proportionality coefficient among strain and couple-stress antisymmetric tensors.*/
	public final String ETA = "ETA";
	
	/** Characteristic length of the Material to the bending.*/
	public final String LENGTH_BENDING = "LENGTH_BENDING";
	
	/** Characteristic length of the Material to the torsion. */
	public final String LENGTH_TORSION = "LENGTH_TORSION";
    	
	/**Constructs a Polar Von Mises Material and sets its type to "PolarVonMises".*/
	public PolarVonMises()
	{
		label = "PolarVonMises";
		this.materialValues = new HashMap<String, Double>(8);	// Qual o tamanho do mapa?
	}
	
	/**Constructs a Von Mises Material and sets its type to "VonMises", its elasticity modulus to elast, its poisson ratio to ni and its hardening modulus to hardening.*/
	
	/**Constructs a Polar Von Mises Material and sets its label to "PolarVonMises". 
	 * @param elast The modulus of elasticity.
	 * @param hardening The hardening modulus.
	 * @param ni The Poisson's ratio.
	 * @param fy The yielding stress .
	 * @param alpha The proportionality coefficient among strain and stress antisymmetric tensors.
	 * @param eta The proportionality coefficient among strain and couple-stress antisymmetric tensors.
	 * @param lf The characteristic length of the Material to the bending.
	 * @param lt The characteristic length of the Material to the torsion.
	 */
	public PolarVonMises(double elast, double hardening, double ni, double fy, double alpha, double eta, double lf, double lt)
	{
		label = "PolarVonMises";
		this.materialValues = new HashMap<String, Double>(8);
		this.setMaterialValues(this.ELASTICITY, elast);
		this.setMaterialValues(this.HARDENING_MODULUS, hardening);
		this.setMaterialValues(this.POISSON, ni);
		this.setMaterialValues(this.YIELDING, fy);
		this.setMaterialValues(this.ALPHA, alpha);
		this.setMaterialValues(this.ETA, eta);
		this.setMaterialValues(this.LENGTH_BENDING, lf);
		this.setMaterialValues(this.LENGTH_TORSION, lt);
	}
	
	/* (non-Javadoc)
     * @see br.ufmg.dees.insane.materialMedia.material.Material#getPt()
     */
	public IMatrix getPt() {
        IMatrix Pt = new IMatrix(6,6);
        Pt.setElement(0,0,(this.getMaterialValues(this.ELASTICITY).doubleValue()));
        Pt.setElement(0,1,(this.getMaterialValues(this.POISSON).doubleValue()));
        Pt.setElement(0,2,(this.getMaterialValues(this.POISSON).doubleValue()));
        Pt.setElement(0,3,(this.getMaterialValues(this.LENGTH_TORSION).doubleValue()));
        Pt.setElement(0,4,(this.getMaterialValues(this.ETA).doubleValue()));
        Pt.setElement(0,5,(this.getMaterialValues(this.ETA).doubleValue()));
        Pt.setElement(1,0,(this.getMaterialValues(this.POISSON).doubleValue()));
        Pt.setElement(1,1,(this.getMaterialValues(this.ELASTICITY).doubleValue()));
        Pt.setElement(1,2,(this.getMaterialValues(this.POISSON).doubleValue()));
        Pt.setElement(1,3,(this.getMaterialValues(this.ETA).doubleValue()));
        Pt.setElement(1,4,(this.getMaterialValues(this.LENGTH_TORSION).doubleValue()));
        Pt.setElement(1,5,(this.getMaterialValues(this.ETA).doubleValue()));
        Pt.setElement(2,0,(this.getMaterialValues(this.POISSON).doubleValue()));
        Pt.setElement(2,1,(this.getMaterialValues(this.POISSON).doubleValue()));
        Pt.setElement(2,2,(this.getMaterialValues(this.ELASTICITY).doubleValue()));
        Pt.setElement(2,3,(this.getMaterialValues(this.ETA).doubleValue()));
        Pt.setElement(2,4,(this.getMaterialValues(this.ETA).doubleValue()));
        Pt.setElement(2,5,(this.getMaterialValues(this.LENGTH_TORSION).doubleValue()));
        Pt.setElement(3,0,(this.getMaterialValues(this.LENGTH_BENDING).doubleValue()));
        Pt.setElement(3,1,(this.getMaterialValues(this.ALPHA).doubleValue()));
        Pt.setElement(3,2,(this.getMaterialValues(this.ALPHA).doubleValue()));
        Pt.setElement(3,3,this.getShearModulus());
        Pt.setElement(4,0,(this.getMaterialValues(this.ALPHA).doubleValue()));
        Pt.setElement(4,1,(this.getMaterialValues(this.LENGTH_BENDING).doubleValue()));
        Pt.setElement(4,2,(this.getMaterialValues(this.ALPHA).doubleValue()));
        Pt.setElement(4,4,this.getShearModulus());
        Pt.setElement(5,0,(this.getMaterialValues(this.ALPHA).doubleValue()));
        Pt.setElement(5,1,(this.getMaterialValues(this.ALPHA).doubleValue()));
        Pt.setElement(5,2,(this.getMaterialValues(this.LENGTH_BENDING).doubleValue()));
        Pt.setElement(5,5,this.getShearModulus());
        return Pt;
    }


    
    
	/* (non-Javadoc)
     * @see br.ufmg.dees.insane.materialMedia.material.Material#getPs()
     */
    public IMatrix getPs() {
    	IMatrix Pt = new IMatrix(6,6);
        Pt.setElement(0,0,(this.getMaterialValues(this.ELASTICITY).doubleValue()));
        Pt.setElement(0,1,(this.getMaterialValues(this.POISSON).doubleValue()));
        Pt.setElement(0,2,(this.getMaterialValues(this.POISSON).doubleValue()));
        Pt.setElement(0,3,(this.getMaterialValues(this.LENGTH_TORSION).doubleValue()));
        Pt.setElement(0,4,(this.getMaterialValues(this.ETA).doubleValue()));
        Pt.setElement(0,5,(this.getMaterialValues(this.ETA).doubleValue()));
        Pt.setElement(1,0,(this.getMaterialValues(this.POISSON).doubleValue()));
        Pt.setElement(1,1,(this.getMaterialValues(this.ELASTICITY).doubleValue()));
        Pt.setElement(1,2,(this.getMaterialValues(this.POISSON).doubleValue()));
        Pt.setElement(1,3,(this.getMaterialValues(this.ETA).doubleValue()));
        Pt.setElement(1,4,(this.getMaterialValues(this.LENGTH_TORSION).doubleValue()));
        Pt.setElement(1,5,(this.getMaterialValues(this.ETA).doubleValue()));
        Pt.setElement(2,0,(this.getMaterialValues(this.POISSON).doubleValue()));
        Pt.setElement(2,1,(this.getMaterialValues(this.POISSON).doubleValue()));
        Pt.setElement(2,2,(this.getMaterialValues(this.ELASTICITY).doubleValue()));
        Pt.setElement(2,3,(this.getMaterialValues(this.ETA).doubleValue()));
        Pt.setElement(2,4,(this.getMaterialValues(this.ETA).doubleValue()));
        Pt.setElement(2,5,(this.getMaterialValues(this.LENGTH_TORSION).doubleValue()));
        Pt.setElement(3,0,(this.getMaterialValues(this.LENGTH_BENDING).doubleValue()));
        Pt.setElement(3,1,(this.getMaterialValues(this.ALPHA).doubleValue()));
        Pt.setElement(3,2,(this.getMaterialValues(this.ALPHA).doubleValue()));
        Pt.setElement(3,3,this.getShearModulus());
        Pt.setElement(4,0,(this.getMaterialValues(this.ALPHA).doubleValue()));
        Pt.setElement(4,1,(this.getMaterialValues(this.LENGTH_BENDING).doubleValue()));
        Pt.setElement(4,2,(this.getMaterialValues(this.ALPHA).doubleValue()));
        Pt.setElement(4,4,this.getShearModulus());
        Pt.setElement(5,0,(this.getMaterialValues(this.ALPHA).doubleValue()));
        Pt.setElement(5,1,(this.getMaterialValues(this.ALPHA).doubleValue()));
        Pt.setElement(5,2,(this.getMaterialValues(this.LENGTH_BENDING).doubleValue()));
        Pt.setElement(5,5,this.getShearModulus());
        return Pt;
    }
   
}